package com.demo.websocket;

import java.util.concurrent.atomic.AtomicInteger;

import com.corundumstudio.socketio.SocketIOClient;
import com.outstading.plugin.netty.socketio.UUIDRegister;
import com.outstanding.framework.base.TransactionLogger;
import com.outstanding.framework.core.PendingException;

public class CountUUIDRegister implements UUIDRegister{

	
	private static AtomicInteger clientCount = new AtomicInteger(0);
	
	@Override
	public String onConnectGetUUID(SocketIOClient client) throws PendingException {
		int num = clientCount.incrementAndGet();
		TransactionLogger.debug("第"+num+"客户端连接进来了");
		
		client.set("count", num);
		return String.valueOf(num);
	}

}
